home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / ADLCOUNT.ICN < prev    next >
Text File  |  1992-09-28  |  992b  |  37 lines

  1. ############################################################################
  2. #
  3. #    File:     adlcount.icn
  4. #
  5. #    Subject:  Program to count address list entries
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 2, 1991
  10. #
  11. ###########################################################################
  12. #
  13. #     This program counts the number of entries in an address list file.
  14. #  If an argument is given, it counts only those that have designators
  15. #  with characters in the argument. Otherwise, it counts all entries.
  16. #
  17. ############################################################################
  18. #
  19. #  See also: address.doc, adlcheck.icn, adlfilter.icn, adllist.icn,
  20. #     adlsort,icn, labels.icn
  21. #
  22. ############################################################################
  23.  
  24. procedure main(arg)
  25.    local s, count
  26.  
  27.    s := cset(arg[1]) | &cset
  28.  
  29.    count := 0
  30.    every !&input ? {
  31.       any('#') & upto(s) \ 1
  32.       } do
  33.       count +:= 1
  34.    write(count)
  35.  
  36. end
  37.